package com.example.daiyinuo.adapter;

import java.util.Objects;

/**
 * 适配器LogAdapter 必须要实现目标接口，且依赖那个提供功能的类型
 */
public class LogDapater implements LogFactory {
    private NbLogger nbLogger;
    public LogDapater(NbLogger nbLogger){
        this.nbLogger = nbLogger;
    }
    @Override
    public void debug(String tag, String message) {
        Objects.requireNonNull(nbLogger);
        nbLogger.debug(1,message);
    }

    public static void main(String[] args) {
        LogFactory logFactory = new LogDapater(new NbLoggerImpl());
        logFactory.debug("DXX","adapter适配器模式");
    }
}
